{% extends 'layouts/master.html' %}

{% set page = 'issues' %}

{% block title %}Gitamin{% endblock %}

{% block breadcrumb %}
    {% include 'partials/breadcrumb.html' with {breadcrumbs: [{dir: 'Issues', path:''}]} %}
{% endblock %}

{% block content %}
	<div class="col-md-9 main-col">
		<div class="panel panel-default">

        <div class="panel-heading">
        <div class="pull-left hidden-sm hidden-xs">
                      <i class="octicon octicon-list-unordered"></i> Issues
                    </div>
                      <ul class="pull-right list-inline remove-margin-bottom thread-filter">
    <li>
        <a href="{{ route('issues', {owner: owner.slug, project: project.slug, filter: 'recent'}) }}">
            <i class="fa fa-history"></i> Recent
        </a>
    </li>
    <li>
        <a href="{{ route('issues', {owner: owner.slug, project: project.slug, filter: 'unanswered'}) }}">
            <i class="fa fa-eye"></i> Unanswered
        </a>
    </li>
</ul>
                    <div class="clearfix"></div>
        </div>

        
            <div class="panel-body remove-padding-horizontal">
            {% if issues.total > 0 %}
                <ul class="list-group row issue-list">
{% for issue in issues %}
         <li class="list-group-item media " style="margin-top: 0px;">

        <a class="pull-right" href="{{ route('issue_show', {owner: project.owner.slug, project: project.slug, iid: issue.iid}) }}">
            <span class="badge badge-reply-count"> {{ issue.comment_count }} </span>
        </a>

        <div class="avatar pull-left">
            <a href="/u/{{ issue.author.username }}">
                <img class="media-object img-thumbnail avatar-48" alt="{{ issue.author.username }}" src="{{ issue.author.avatar_small }}">
            </a>
        </div>

        <div class="infos">

          <div class="media-heading">
            <a href="{{ route('issue_show', {owner: project.owner.slug, project: project.slug, iid: issue.iid}) }}" title="test">
                {{ issue.title }}
            </a>
            
          </div>
         
          <div class="media-body meta">
				<span>回复</span>
                <a href="/u/{{ issue.author.username }}">
                  {{ issue.author.username }}
                </a>
                <span> • </span>
                <span class="timeago " data-toggle="tooltip" data-placement="top" title="" data-original-title="{{ issue.updated_at }}">{{ issue.updated_at }}</span>
                      </div>

        </div>
    </li>
    {% endfor %}
    </ul>
    {% else %}
    <div class="empty-block">There aren’t issues.</div>
    {% endif %}

            </div>

            <div class="panel-footer text-right remove-padding-horizontal pager-footer">
                <!-- Pager -->
                {{ issues.appends(input.all()).render() | raw }}
            </div>

        
    </div>
	</div>
	<div class="col-md-3 side-bar">
        <div class="panel panel-default corner-radius help-box">
      <div class="panel-heading text-center">
        <h3 class="panel-title">Gitamin</h3>
      </div>
      <div class="panel-body text-center">
        <a class="btn btn-success" href="{{ route('issue_new', {owner: project.owner.slug, project: project.slug}) }}">new issue</a>
       </div>
    </div>

	</div>
	<div class="clearfix"></div>
{% endblock %}
